package musictube.client;

import java.util.HashMap;

/**
 * Hardcoded implementation of {@link IDatabase}.
 * 
 * <p>
 * This is a demo database for testing purposes only.
 * </p>
 * 
 * @author Russell Souza
 */
public class HardcodedDatabase implements IDatabase {

	/**
	 * HashMap to store mapping from song name to youtube location.
	 * 
	 * <p>
	 * The key and value are both simple Strings.
	 * </p>
	 */
	private final HashMap m_map;

	/**
	 * Constructor.
	 * 
	 * <p>
	 * Creates and populates the database.
	 * </p>
	 */
	public HardcodedDatabase() {

		// create the HashMap data store
		m_map = new HashMap(10);

		// add test data
		m_map.put("Blue October - Hate Me",
				"http://youtube.com/watch?v=gOziJi-1hHE");
		m_map.put("Blue October - Calling You",
				"http://youtube.com/watch?v=OsvoTkx1mQY");
		m_map.put("Finger Eleven - Paralyzer",
				"http://youtube.com/watch?v=QgaCHmxmeUo");
		m_map.put("Flo Rida - Low", "http://youtube.com/watch?v=BNS8IdMxTjg");
		m_map.put("Timberland - The Way I Are",
				"http://youtube.com/watch?v=v_-1peCW6Ok");
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see musictube.client.IDatabase#getAllItems()
	 */
	public HashMap getAllItems() {
		return m_map;
	}
}
